
import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart';
import 'package:qianyi/controller/imageDetailUserController.dart';
import 'package:qianyi/entity/home/alumb_vo_list.dart';
import 'package:qianyi/entity/home/trendVo.dart';
import 'package:qianyi/network/http_entity.dart';
import 'package:shared_preferences/shared_preferences.dart';

import '../../entity/profile/my_user_info_entity.dart';
import '../../network/base_entity.dart';
import '../../network/http_config.dart';
import '../../network/http_manager.dart';
import '../../ui/widget/custom_refresh_mixin.dart';
import '../../utils/navigator_util.dart';


class ImageAlbumViewModel extends ChangeNotifier with CustomRefreshMixin {

  TabController? tabController;

  ImageDetailUserController imageDetailUserController = Get.find();


  @override
  Future<List> requestList(int page) async {
    SharedPreferences prefs = await SharedPreferences.getInstance();
    Map<String,dynamic> userInfo = jsonDecode(prefs.getString("userInfo")!);


    Map<String, dynamic> params = {};
    params["uid"] = imageDetailUserController.userId;

    IBaseEntity? result = await HttpManager.getInstance().request(url: "/platform/album/getAllAlbum",method: Method.get, params: params);
    HttpEntity httpEntity = result as HttpEntity;
    AlbumVoList trendEntityList = AlbumVoList.fromJson(httpEntity.oriData['data']);


    notifyListeners();

    return trendEntityList.albumVos!;
  }

}
